import { HTTP } from '../common/utils/http'

class OrderModel extends HTTP {
    // 创建订单
    addOrder(data) {
        return this.request({
            url: '/api/buy_now',
            method: 'POST',
            data
        })
    }
    // 获取用户的订单信息
    getUserOrder(data) {
        return this.request({
            url: '/api/order_list',
            method: 'GET',
            data
        })
    }
    // 获取实物订单详情
    getTrueOrderDetail(data) {
        return this.request({
            url: '/api/Orders/GetOrderDetails',
            method: 'POST',
            data
        })
    }
    // 取消订单未发货
    cancelOrderNoSend(data) {
        return this.request({
            url: '/api/after/refund',
            method: 'POST',
            data
        })
    }
    // 取消订单已发货
    cancelOrderSend(data) {
        return this.request({
            url: '/api/after/rejected',
            method: 'POST',
            data
        })
    }
    // 确认收货
    confirmReceipt(data) {
        return this.request({
            url: '/api/after/refund',
            method: 'POST',
            data
        })
    }
    // 评价
    commentOrder(data) {
        return this.request({
            url: '/api/order/comment',
            method: 'POST',
            data
        })
    }
    // 更多评价
    getCommentMore(data) {
        return this.request({
            url: '/api/more/comment',
            method: 'GET',
            data
        })
    }
    // 上传图片
    uploadImage(data) {
        return this.request({
            url: '/upload',
            method: 'POST',
            data
        })
    }
    // 订单微信支付
    orderWechatPayment(data) {
        return this.request({
            url: '/api/wechat/payment',
            method: 'POST',
            data
        })
    }
    // 订单详情
    getOrderDetail(id) {
        return this.request({
            url: `/api/order/${id}`
        })
    }
    // 拼团订单
    getGroupBuyOrder(data) {
        return this.request({
            url: '/api/groupBuyOrder',
            data
        })
    }
    // 拼单详情
    getGroupOrderDetail(id) {
        return this.request({
            url: `/api/groupBuyOrderDetails/${id}`
        })
    }
}
export { OrderModel }

